package com.mofeng.myshop.domain.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.mofeng.myshop.domain.po.AddressMap;
import com.mofeng.myshop.domain.po.Project;
import com.mofeng.myshop.domain.vo.base.BaseVo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class AddressMapVo extends BaseVo {

    @Schema(description = "项目ID")
    private String projectId;

    @Schema(description = "项目名称")
    private String projectName;

    @Schema(description = "rcon端口")
    private Integer rconPort;

    @Schema(description = "服务器端口")
    private Integer serverPort;

    @Schema(description = "地图类型")
    private Integer mapType;// 0 pve 1 pvp

    @Schema(description = "发货方式, 1 steamID  2 游戏ID")
    private String sendType;// 0 pve

    @Schema(description = "ip")
    private String ip;

    @Schema(description = "密码")
    private String password;

    @Schema(description = "图片")
    private String image;

    @Schema(description = "是否在线")
    private boolean onLine = false;

    private String openLink = "";

    public AddressMapVo(AddressMap addressMap) {
        super(addressMap);
        Project project = addressMap.getProject();
        if (project != null) {
            this.projectName = project.getName();
        }

        this.projectId = addressMap.getProjectId() == null ? "" : addressMap.getProjectId().toString();

        this.rconPort = addressMap.getRconPort();

        this.serverPort = addressMap.getServerPort();

        this.mapType = addressMap.getMapType();

        this.ip = addressMap.getIp();

        this.password = addressMap.getPassword();

        this.sendType = addressMap.getSendType();

        this.image = addressMap.getImage();
    }


}
